import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class AppBarIconPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child:Scaffold(
        appBar: AppBar(
          title: Text("AppBarIconPage"),
          backgroundColor: Colors.green, //更改颜色
          centerTitle: true,  //居中显示
          leading: IconButton(  //左上角图标
            icon: Icon(Icons.menu),
            onPressed: (){
              Navigator.of(context).pop();
            },
          ),
          actions: <Widget>[ //右上角图标 可以增加多个图标
            IconButton(
              icon: Icon(Icons.search),
              onPressed: (){},
            )
          ]
        )
      ),
    );
  }
}
